<html>
<head><meta charset="utf-8"><title>meeting 2021-04-13 · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html">meeting 2021-04-13</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234331420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234331420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234331420">(Apr 13 2021 at 14:08)</a>:</h4>
<p>meeting in less than 40 minutes</p>



<a name="234331783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234331783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234331783">(Apr 13 2021 at 14:10)</a>:</h4>
<p>my idea is to continue where we left off 2 weeks ago and talk a bit more about how we want generic constants to behave</p>



<a name="234338425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234338425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234338425">(Apr 13 2021 at 14:45)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="3805">@project-const-generics</span> meeting's officially starting now</p>



<a name="234338472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234338472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234338472">(Apr 13 2021 at 14:45)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="234338676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234338676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234338676">(Apr 13 2021 at 14:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> r u here? i think we probably want to revisit that question: <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232446238">https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232446238</a></p>



<a name="234338780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234338780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234338780">(Apr 13 2021 at 14:47)</a>:</h4>
<p>I'm here</p>



<a name="234339125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234339125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234339125">(Apr 13 2021 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> say more :)</p>



<a name="234339135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234339135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234339135">(Apr 13 2021 at 14:49)</a>:</h4>
<p>let me re-read, I guess</p>



<a name="234340444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340444">(Apr 13 2021 at 14:56)</a>:</h4>
<p>k, I caught up</p>



<a name="234340474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340474">(Apr 13 2021 at 14:56)</a>:</h4>
<p>were you proposing <span class="user-mention" data-user-id="216206">@lcnr</span> to talk about the notion of equality first and foremost?</p>



<a name="234340561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340561">(Apr 13 2021 at 14:56)</a>:</h4>
<p>that would be good i think</p>



<a name="234340726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340726">(Apr 13 2021 at 14:57)</a>:</h4>
<p>I'm collecting my thoughts here</p>



<a name="234340740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340740">(Apr 13 2021 at 14:57)</a>:</h4>
<p>still not completely sure what's the best way to talk about all of this '^^</p>



<a name="234340758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340758">(Apr 13 2021 at 14:57)</a>:</h4>
<p>yeah</p>



<a name="234340847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340847">(Apr 13 2021 at 14:58)</a>:</h4>
<p>before we dive in there, I'm trying to cache back in whatever it was we talked about the other day in that zoom call</p>



<a name="234340877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340877">(Apr 13 2021 at 14:58)</a>:</h4>
<p>ah yes, type checking</p>



<a name="234340892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340892">(Apr 13 2021 at 14:58)</a>:</h4>
<p>and the need to type check again after substitution</p>



<a name="234340929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234340929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234340929">(Apr 13 2021 at 14:58)</a>:</h4>
<p>did you look or think about that anymore at all?</p>



<a name="234341021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234341021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234341021">(Apr 13 2021 at 14:59)</a>:</h4>
<p>i did post a short message in <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/run.20mir-typeck.20on.20constants.20before.20evaluating.20them/near/232626558">https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/run.20mir-typeck.20on.20constants.20before.20evaluating.20them/near/232626558</a></p>



<a name="234341445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234341445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234341445">(Apr 13 2021 at 15:00)</a>:</h4>
<p>because i remembered that we already have to filter the where clauses available to anon consts inside of where clauses</p>



<a name="234341500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234341500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234341500">(Apr 13 2021 at 15:00)</a>:</h4>
<p>which i didn't mention during that meeting</p>



<a name="234342703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234342703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234342703">(Apr 13 2021 at 15:03)</a>:</h4>
<p>hmm</p>



<a name="234342741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234342741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234342741">(Apr 13 2021 at 15:03)</a>:</h4>
<p>I'm not sure that this changes anything too fundamental, right?</p>



<a name="234342863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234342863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234342863">(Apr 13 2021 at 15:04)</a>:</h4>
<p>it doesn't ^^</p>



<a name="234342957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234342957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234342957">(Apr 13 2021 at 15:04)</a>:</h4>
<p>it potentially makes retypechecking substituted consts a bit faster, because we only have to check their caller bounds</p>



<a name="234343183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343183">(Apr 13 2021 at 15:05)</a>:</h4>
<p>but it doesn't solve the general problem of consts in where clauses not necessarily being wf after substitution</p>



<a name="234343385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343385">(Apr 13 2021 at 15:06)</a>:</h4>
<p>ok</p>



<a name="234343391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343391">(Apr 13 2021 at 15:06)</a>:</h4>
<p>so</p>



<a name="234343399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343399">(Apr 13 2021 at 15:06)</a>:</h4>
<p>as for equality</p>



<a name="234343449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343449">(Apr 13 2021 at 15:06)</a>:</h4>
<p>I definitely would prefer to start with something fairly conservative</p>



<a name="234343471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343471">(Apr 13 2021 at 15:06)</a>:</h4>
<p>i think that typechecking consts again before evaluating them is probably the best way forward here for now</p>



<a name="234343505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343505">(Apr 13 2021 at 15:06)</a>:</h4>
<p>although I think that people are definitely going to be surprised when <code>N+1</code> and <code>1+N</code> are not considered equivalent</p>



<a name="234343526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343526">(Apr 13 2021 at 15:06)</a>:</h4>
<p>this is of course a well-studied problem</p>



<a name="234343560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343560">(Apr 13 2021 at 15:06)</a>:</h4>
<p>there are a standard set of transformations that are often used</p>



<a name="234343605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343605">(Apr 13 2021 at 15:06)</a>:</h4>
<p>I'm trying to remember now, I have to go check my compiler text books</p>



<a name="234343633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343633">(Apr 13 2021 at 15:07)</a>:</h4>
<p>I believe there is a table in one of them for using within CSE</p>



<a name="234343747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234343747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234343747">(Apr 13 2021 at 15:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234343471">said</a>:</p>
<blockquote>
<p>i think that typechecking consts again before evaluating them is probably the best way forward here for now</p>
</blockquote>
<p>I'm in favor of this for the time being</p>



<a name="234344128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344128">(Apr 13 2021 at 15:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234343505">said</a>:</p>
<blockquote>
<p>although I think that people are definitely going to be surprised when <code>N+1</code> and <code>1+N</code> are not considered equivalent</p>
</blockquote>
<p>my experience with this up until now was that having <code>N+1</code> and <code>1+N</code> not being equal isn't too bad</p>



<a name="234344262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344262">(Apr 13 2021 at 15:09)</a>:</h4>
<p>the general problem with these canonicalization strategies concerns overflow and the like</p>



<a name="234344316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344316">(Apr 13 2021 at 15:09)</a>:</h4>
<p>I was just checking; Muchnick has a table</p>



<a name="234344335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344335">(Apr 13 2021 at 15:09)</a>:</h4>
<p>it seems to me to be irrelevant :)</p>



<a name="234344377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344377">(Apr 13 2021 at 15:09)</a>:</h4>
<p>to clarify:</p>



<a name="234344419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344419">(Apr 13 2021 at 15:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234344128">said</a>:</p>
<blockquote>
<p>my experience with this up until now was that having <code>N+1</code> and <code>1+N</code> not being equal isn't too bad</p>
</blockquote>
<p>which doesn't really mean too much, cause the people i interact with are not really representative</p>



<a name="234344479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344479">(Apr 13 2021 at 15:10)</a>:</h4>
<p>I feel like we can start with a "canon" function is basically an identify function</p>



<a name="234344530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344530">(Apr 13 2021 at 15:10)</a>:</h4>
<p>however</p>



<a name="234344736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344736">(Apr 13 2021 at 15:11)</a>:</h4>
<p>hmm</p>



<a name="234344768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234344768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234344768">(Apr 13 2021 at 15:11)</a>:</h4>
<p>I'd like to step ever so slightly back</p>



<a name="234345073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345073">(Apr 13 2021 at 15:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234344479">said</a>:</p>
<blockquote>
<p>I feel like we can start with a "canon" function is basically an identify function</p>
</blockquote>
<p>depending on whether it's relevant to what you want to go back to, can you elaborate a bit here?</p>



<a name="234345593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345593">(Apr 13 2021 at 15:14)</a>:</h4>
<p>well</p>



<a name="234345624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345624">(Apr 13 2021 at 15:14)</a>:</h4>
<p>if I understood the previous topic correctly</p>



<a name="234345653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345653">(Apr 13 2021 at 15:14)</a>:</h4>
<p>we were saying that there needs to be some kind of equality comparison of the expression tree itself</p>



<a name="234345689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345689">(Apr 13 2021 at 15:15)</a>:</h4>
<p>perhaps with some "canonicalization" beforehand</p>



<a name="234345708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345708">(Apr 13 2021 at 15:15)</a>:</h4>
<p>for example, evaluating constant subtrees</p>



<a name="234345739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345739">(Apr 13 2021 at 15:15)</a>:</h4>
<p>or reordering <code>+</code> operands</p>



<a name="234345805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345805">(Apr 13 2021 at 15:15)</a>:</h4>
<p>what I am saying is that the details of what we canonicalize don't matter</p>



<a name="234345825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345825">(Apr 13 2021 at 15:15)</a>:</h4>
<p>the basic model remains the same either way</p>



<a name="234345858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345858">(Apr 13 2021 at 15:15)</a>:</h4>
<p>you apply <em>some</em> function to the HIR (I guess)</p>



<a name="234345893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345893">(Apr 13 2021 at 15:16)</a>:</h4>
<p>you get back a HIR</p>



<a name="234345945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345945">(Apr 13 2021 at 15:16)</a>:</h4>
<p>possibly with embedded val trees</p>



<a name="234345986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234345986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234345986">(Apr 13 2021 at 15:16)</a>:</h4>
<p>HIR is maybe not right -- maybe we have some other representation for the 'expression tree' of a constant?</p>



<a name="234346000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346000">(Apr 13 2021 at 15:16)</a>:</h4>
<p>or maybe we even use MIR, god help us?</p>



<a name="234346087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346087">(Apr 13 2021 at 15:17)</a>:</h4>
<p>rn we use a small subset of mir</p>



<a name="234346152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346152">(Apr 13 2021 at 15:17)</a>:</h4>
<p>i think we previously quickly touched on using thir instead</p>



<a name="234346211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346211">(Apr 13 2021 at 15:17)</a>:</h4>
<p>so rn it's: MIR -&gt; <code>AbstractConst</code></p>



<a name="234346221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346221">(Apr 13 2021 at 15:17)</a>:</h4>
<p>One problem I can foresee with canonicalisation is that, when we introduce custom types, canonicalisation will only be performed for some types (i.e. the primitive ones), because equality may be overloaded in such a way as to make it disobey commutativity, etc.</p>



<a name="234346332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346332">(Apr 13 2021 at 15:18)</a>:</h4>
<p>Which may be confusing to users.</p>



<a name="234346418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346418">(Apr 13 2021 at 15:18)</a>:</h4>
<p>would <code>unsafe trait Commutative: std::ops::Add {}</code> be a horrible idea</p>



<a name="234346530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346530">(Apr 13 2021 at 15:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234346221">said</a>:</p>
<blockquote>
<p>One problem I can foresee with canonicalisation is that, when we introduce custom types, canonicalisation will only be performed for some types (i.e. the primitive ones), because equality may be overloaded in such a way as to make it disobey commutativity, etc.</p>
</blockquote>
<p>so this is an important question</p>



<a name="234346556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346556">(Apr 13 2021 at 15:19)</a>:</h4>
<p>I used to be a strong advocate for "one notion of equality" only</p>



<a name="234346588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346588">(Apr 13 2021 at 15:19)</a>:</h4>
<p>but I've kind of come around to "syntactic equality" vs "runtime equality" -- probably need better names</p>



<a name="234346669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346669">(Apr 13 2021 at 15:20)</a>:</h4>
<p>this applies also pattern matching</p>



<a name="234346715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346715">(Apr 13 2021 at 15:20)</a>:</h4>
<p>part of it is that I just want to be done with this discussion and in the end I don't think it's THAT important :P</p>



<a name="234346748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346748">(Apr 13 2021 at 15:20)</a>:</h4>
<p>but it also seems useful to be able to (e.g.) match on a floating point value and put <code>NaN</code> as the pattern...</p>



<a name="234346907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346907">(Apr 13 2021 at 15:21)</a>:</h4>
<p>point being though that I <em>definitely</em> think that const generics equality cannot be the same as <code>Eq</code> trait</p>



<a name="234346918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346918">(Apr 13 2021 at 15:21)</a>:</h4>
<p>we need to be able to do unification</p>



<a name="234346936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346936">(Apr 13 2021 at 15:21)</a>:</h4>
<p>and that's going to be a stricter notion of equality</p>



<a name="234346939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346939">(Apr 13 2021 at 15:21)</a>:</h4>
<p>it plays into this</p>



<a name="234346947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234346947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234346947">(Apr 13 2021 at 15:21)</a>:</h4>
<p>now that I think about it</p>



<a name="234347094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347094">(Apr 13 2021 at 15:22)</a>:</h4>
<p>and I guess once we have const generics having a notion of equality, it seems potentially reasonable to use the same notion for pattern matching on a constant? I'm debating if I believe that :)</p>



<a name="234347152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347152">(Apr 13 2021 at 15:22)</a>:</h4>
<p>those seem somewhat fundamentally different, since const generics is compilation time</p>



<a name="234347162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347162">(Apr 13 2021 at 15:22)</a>:</h4>
<p>i still haven't read into this again</p>



<a name="234347167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347167">(Apr 13 2021 at 15:22)</a>:</h4>
<p>but</p>



<a name="234347236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347236">(Apr 13 2021 at 15:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234347094">said</a>:</p>
<blockquote>
<p>and I guess once we have const generics having a notion of equality, it seems potentially reasonable to use the same notion for pattern matching on a constant? I'm debating if I believe that :)</p>
</blockquote>
<p>That's an interesting suggestion.</p>



<a name="234347238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347238">(Apr 13 2021 at 15:23)</a>:</h4>
<p>pattern matching sometimes reasons about values instead of types</p>



<a name="234347313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347313">(Apr 13 2021 at 15:23)</a>:</h4>
<p>so <code>None::&lt;NonStructuralMatch&gt;</code> is still usable for patterns</p>



<a name="234347439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347439">(Apr 13 2021 at 15:24)</a>:</h4>
<p>yes</p>



<a name="234347503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347503">(Apr 13 2021 at 15:24)</a>:</h4>
<p>i personally think that - at least partially - splitting "structural match for patterns" and "const generics equality" is needed/a good idea</p>



<a name="234347509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347509">(Apr 13 2021 at 15:24)</a>:</h4>
<p>pattern matching a (potentially unary) enum variant is definitely distinct from <code>==</code></p>



<a name="234347532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347532">(Apr 13 2021 at 15:24)</a>:</h4>
<p>which is probably a better argument than the one I was making</p>



<a name="234347642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347642">(Apr 13 2021 at 15:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234347503">said</a>:</p>
<blockquote>
<p>i personally think that - at least partially - splitting "structural match for patterns" and "const generics equality" is needed/a good idea</p>
</blockquote>
<p>I suppose they will be split, but related-- e.g., structural match for patterns will still evaluate arithmetic expressions fully</p>



<a name="234347731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347731">(Apr 13 2021 at 15:25)</a>:</h4>
<p>(well, there is also the question of how to handle monomorphization and pattern matching on constants)</p>



<a name="234347798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234347798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234347798">(Apr 13 2021 at 15:26)</a>:</h4>
<p>If <code>None::&lt;NonStructuralMatch&gt;</code>is secretly viewed as a variant type, then the <code>NonStructuralMatch</code> wouldn't affect <code>None</code>, making it type-based again.</p>



<a name="234348035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348035">(Apr 13 2021 at 15:27)</a>:</h4>
<p>I view it as a distinct form of pattern</p>



<a name="234348056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348056">(Apr 13 2021 at 15:27)</a>:</h4>
<p>Perhaps, yes.</p>



<a name="234348063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348063">(Apr 13 2021 at 15:27)</a>:</h4>
<p>there are <em>enum variant patterns</em> and <em>constant patterns</em></p>



<a name="234348121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348121">(Apr 13 2021 at 15:27)</a>:</h4>
<p>enum variant patterns test what variant the enum has (and match the data within)</p>



<a name="234348262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348262">(Apr 13 2021 at 15:28)</a>:</h4>
<p>the behavior of constant patterns is less clear :)</p>



<a name="234348276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348276">(Apr 13 2021 at 15:28)</a>:</h4>
<p>anyway, ok, I think this is a tangent</p>



<a name="234348283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348283">(Apr 13 2021 at 15:28)</a>:</h4>
<p>So... if you have a constant in a pattern match, whose value is an enum variant, this should be matched differently to inlining the variant?</p>



<a name="234348312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348312">(Apr 13 2021 at 15:28)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a9ce0650447a1faf39ea12ad2e919a22">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a9ce0650447a1faf39ea12ad2e919a22</a></p>



<a name="234348342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348342">(Apr 13 2021 at 15:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234348283">said</a>:</p>
<blockquote>
<p>So... if you have a constant in a pattern match, whose value is an enum variant, this should be matched differently to inlining the variant?</p>
</blockquote>
<p>under the model I just described, potentially yes</p>



<a name="234348348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348348">(Apr 13 2021 at 15:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234348276">said</a>:</p>
<blockquote>
<p>anyway, ok, I think this is a tangent</p>
</blockquote>
<p>Yes, this is more about the design, rather than implementation.</p>



<a name="234348472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348472">(Apr 13 2021 at 15:29)</a>:</h4>
<p>it depends on what semantics we opted for with matching constant patterns</p>



<a name="234348484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348484">(Apr 13 2021 at 15:30)</a>:</h4>
<p>if it is was compiled to <code>==</code>...</p>



<a name="234348525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348525">(Apr 13 2021 at 15:30)</a>:</h4>
<p>...then it might well be different</p>



<a name="234348642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348642">(Apr 13 2021 at 15:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234348312">said</a>:</p>
<blockquote>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a9ce0650447a1faf39ea12ad2e919a22">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a9ce0650447a1faf39ea12ad2e919a22</a></p>
</blockquote>
<p>yeah, that's...unfortunate</p>



<a name="234348661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348661">(Apr 13 2021 at 15:30)</a>:</h4>
<p>well, maybe not, but it's certainly relevant :)</p>



<a name="234348708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234348708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234348708">(Apr 13 2021 at 15:31)</a>:</h4>
<p>I tried to future-proof here to allow for more degrees of freedom but didn't really get it right</p>



<a name="234349093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349093">(Apr 13 2021 at 15:33)</a>:</h4>
<p>should have maybe said something instead of only posting that link '^^</p>



<a name="234349197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349197">(Apr 13 2021 at 15:33)</a>:</h4>
<p><em>anyway</em></p>



<a name="234349301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349301">(Apr 13 2021 at 15:34)</a>:</h4>
<p>is this pressing, <span class="user-mention" data-user-id="216206">@lcnr</span> ?</p>



<a name="234349318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349318">(Apr 13 2021 at 15:34)</a>:</h4>
<p>what is the overall status of things?</p>



<a name="234349330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349330">(Apr 13 2021 at 15:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234348063">said</a>:</p>
<blockquote>
<p>there are <em>enum variant patterns</em> and <em>constant patterns</em></p>
</blockquote>
<p>my concern is that this distinction isn't as clear as i would ideally want it to be</p>



<a name="234349341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349341">(Apr 13 2021 at 15:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234349301">said</a>:</p>
<blockquote>
<p>is this pressing, <span class="user-mention silent" data-user-id="216206">lcnr</span> ?</p>
</blockquote>
<p>no</p>



<a name="234349444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349444">(Apr 13 2021 at 15:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234349318">said</a>:</p>
<blockquote>
<p>what is the overall status of things?</p>
</blockquote>
<p>i am not really doing much rust rn</p>



<a name="234349491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349491">(Apr 13 2021 at 15:35)</a>:</h4>
<p>so there isn't a lot of progress on generic const expressions afaik</p>



<a name="234349612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349612">(Apr 13 2021 at 15:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234349330">said</a>:</p>
<blockquote>
<p>my concern is that this distinction isn't as clear as i would ideally want it to be</p>
</blockquote>
<p>yes. to be clear, I am coming around to make the semantics equivalent, though I think there are some challenges</p>



<a name="234349664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349664">(Apr 13 2021 at 15:36)</a>:</h4>
<p>this does imply that <code>a == C</code> and <code>match a { C =&gt; .. }</code> are not equivalent but...</p>



<a name="234349779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234349779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234349779">(Apr 13 2021 at 15:37)</a>:</h4>
<p>I think that's probably acceptable.</p>



<a name="234350008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350008">(Apr 13 2021 at 15:38)</a>:</h4>
<p>as I said, I'm coming around :)</p>



<a name="234350118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350118">(Apr 13 2021 at 15:39)</a>:</h4>
<p>of course if always means <code>match a { x if x == C =&gt; ... }</code> and <code>match a { C =&gt; ...</code> are not equivalent</p>



<a name="234350160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350160">(Apr 13 2021 at 15:39)</a>:</h4>
<p>but at the end of the day it seems like there isn't a sol'n that matches all the expectations at once</p>



<a name="234350246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350246">(Apr 13 2021 at 15:40)</a>:</h4>
<p>plus I think anyone whose <code>==</code> is not equivalent to <code>derive(Eq)</code> is ultimately asking for trouble :)</p>



<a name="234350539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350539">(Apr 13 2021 at 15:41)</a>:</h4>
<p>Yes, I think it's simpler to think of <code>==</code> as an equivalence relation (ideally, but the laws aren't actually enforced) that does not necessarily match true equality, which is given by structural equality.</p>



<a name="234350630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350630">(Apr 13 2021 at 15:42)</a>:</h4>
<p>right, and then const generics equality is a subset of structural equality</p>



<a name="234350668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350668">(Apr 13 2021 at 15:42)</a>:</h4>
<p>basically "structural equality we can see statically"</p>



<a name="234350738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350738">(Apr 13 2021 at 15:42)</a>:</h4>
<p>I think I agree with this</p>



<a name="234350758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350758">(Apr 13 2021 at 15:43)</a>:</h4>
<p>plus it makes examples like the one <span class="user-mention" data-user-id="216206">@lcnr</span> gave non-problematic</p>



<a name="234350768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350768">(Apr 13 2021 at 15:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234350630">said</a>:</p>
<blockquote>
<p>right, and then const generics equality is a subset of structural equality</p>
</blockquote>
<p><del>(As long as users aren't doing nasty things, like irreflexive <code>==</code>. But then they're asking for strange behaviour.)</del></p>



<a name="234350785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350785">(Apr 13 2021 at 15:43)</a>:</h4>
<p>the main concern is that if you have associated constants or similar things in patterns, you are stuck</p>



<a name="234350806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350806">(Apr 13 2021 at 15:43)</a>:</h4>
<p>but you can be conservative and handle those at monomorphization time</p>



<a name="234350856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350856">(Apr 13 2021 at 15:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234350768">said</a>:</p>
<blockquote>
<p>(As long as users aren't doing nasty things, like irreflexive <code>==</code>. But then they're asking for strange behaviour.)</p>
</blockquote>
<p>wait, this confuses me. I think of <code>==</code> as divorced from structural equality</p>



<a name="234350911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234350911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234350911">(Apr 13 2021 at 15:44)</a>:</h4>
<p>sort of "ideally related but not necessarily"</p>



<a name="234351180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234351180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234351180">(Apr 13 2021 at 15:45)</a>:</h4>
<p>Sorry, I misread your earlier comment. That's correct.</p>



<a name="234352291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234352291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234352291">(Apr 13 2021 at 15:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-13/near/234346418">said</a>:</p>
<blockquote>
<p>would <code>unsafe trait Commutative: std::ops::Add {}</code> be a horrible idea</p>
</blockquote>
<p>as long as we can't be generic over traits, yes <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="234352357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-13/near/234352357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-13.html#234352357">(Apr 13 2021 at 15:52)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">unsafe</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">CommutativeAdd</span>: <span class="nc">Add</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">unsafe</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">CommutativeSub</span>: <span class="nc">Sub</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>